<template>
  <div>
    <el-form ref="dataForm" :model="form" label-width="100px">
      <div class="ledgerTitle">项目信息</div>
      <el-row>
        <el-col :span="6">
          <el-form-item label-width="110px" label="项目编号:" prop="projectCode">
            {{ form.projectCode }}
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label-width="110px" label="项目名称:" prop="projectName">
            {{ form.projectName }}
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label-width="140px" label="立项日期:" prop="projectDate">
            {{ form.projectDate }}
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label-width="110px" label="年度:" prop="projectYear">
            {{ form.projectYear }}
          </el-form-item>
        </el-col>
      </el-row>
      <div class="ledgerTitle">审计分工</div>
      <el-row>
        <el-col :span="12">
          <el-form-item label-width="110px" label="协审单位:" prop="assistCompanyName">
            {{ form.assistCompanyName }}
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label-width="140px" label="协审单位组长:" prop="assistLeader">
            {{ form.assistLeader }}
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label-width="110px" label="建设单位:" prop="auditedCompanyName">
            {{ form.auditedCompanyName }}
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label-width="140px" label="建设单位联络员:" prop="auditedCompanyUserName">
            {{ form.auditedCompanyUserName }}
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col>
          <el-form-item label-width="110px" label="审计组成员:" prop="assistMembers">
            {{ form.assistMembers }}
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </div>
</template>

<script>
import {getProject} from "@/api/adis/project/project";

export default {
  name: 'TerminationProjectView',
  props: {
    id: {
      type: String,
      default: ''
    },
    params: {
      type: Object,
    },
    isAudit: {
      type: Boolean,
      default: false,
    }
  },
  components: {},
  dictTypes: ['audit_type', 'audit_type_1_sub', 'project_progress', 'audit_way', 'organization_type'],
  data() {
    return {
      form: {},
    }
  },
  watch: {
    id: {
      handler(val) {
        if (val) {
          getProject(this.id).then((res) => {
            if (res.data.data !== null){
              this.form = res.data.data;
              this.$emit('data-loaded', true);
            } else {
              this.$emit('data-loaded', false);
            }
          }).catch(() => {
            this.$emit('data-loaded', false);
          });
        }
      },deep: true, immediate: true
    },
    params: {
      handler(val){
        if (val){
          this.form = val
        }
      },deep: true, immediate: true
    }
  },
}
</script>

